//
//  MeViewController.m
//  fxxiaoke
//
//  Created by 鞠超 on 16/9/3.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "MeViewController.h"

#import "MineListTableViewCell.h"
#import "SettingViewController.h"
#import "Micro_BusinessCardViewController.h"
#import "Mine_WalletViewController.h"
#import "Mine_KanboxViewController.h"
#import "Mine_ProgrammeViewController.h"
#import "Mine_AddressbookViewController.h"
#import "Mine_TopicViewController.h"
#import "Mine_CollectViewController.h"
#import "Mine_DraftsViewController.h"
#import "Mine_WorkingViewController.h"

@interface MeViewController () <UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView * tableView;
//
@property (nonatomic, strong) UIImageView * image_heads;
@property (nonatomic, strong) UILabel * name;
@property (nonatomic, strong) UILabel * department;
@property (nonatomic, strong) UILabel * job_title;

//阴影效果二维码
@property (nonatomic, strong) UIView * view_shadow;
@property (nonatomic, strong) UIView * view_middleWihte;
@property (nonatomic, strong) UIImageView * image_barcode;

@end

@implementation MeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self p_navi];
    
    [self p_setupView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - navi
- (void)p_navi
{
    _btnLeft.hidden = YES;
    _lblLeft.hidden = YES;
    _btnRight.hidden = YES;
    _lblRight.hidden = YES;
    
    _lblTitle.text = @"我";
    
    UIImageView * image_Setting = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 35, 32, 20, 20)];
    image_Setting.image = [UIImage imageNamed:@"Setting.png"];
    [_topView addSubview:image_Setting];
    
    UIButton * btn_Setting = [UIButton buttonWithType:(UIButtonTypeSystem)];
    btn_Setting.frame = CGRectMake(SCREEN_WIDTH - 10 - 35, 24.5, 35, 35);
    [_topView addSubview:btn_Setting];
    [btn_Setting addTarget:self action:@selector(SettingAction:) forControlEvents:(UIControlEventTouchUpInside)];
}

//右侧设置
- (void)SettingAction:(UIButton *)sender
{
//    NSLog(@"点击进入设置页面");
    
    SettingViewController * settingViewController = [[SettingViewController alloc] init];
    [self showViewController:settingViewController sender:nil];
}

//显示tabbar
- (void )viewWillAppear:(BOOL)animated
{
    [(AppDelegate *)[[UIApplication sharedApplication] delegate] showTabBar];
}

#pragma mark - 布局
- (void)p_setupView
{
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - 49) style:(UITableViewStylePlain)];
    self.tableView.showsVerticalScrollIndicator = NO;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.tableFooterView = [[UIView alloc] init];
    [self.view addSubview:self.tableView];
    
    //注册
    [self.tableView registerClass:[MineListTableViewCell class] forCellReuseIdentifier:@"cell_list"];
    
    //弹出二维码页面
    [self p_barcode];
}

#pragma mark - tableview代理
- (NSInteger )numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger )tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 7;
}

- (CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(indexPath.row == 0)
    {
        return 191;
    }
    if(indexPath.row == 4)
    {
        return 10;
    }
    if(indexPath.row == 6)
    {
        return 10;
    }
    else
    {
        return 60;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [[UITableViewCell alloc] init];
    
    if(indexPath.row == 0)
    {
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        UIView * view_topLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10)];
        view_topLine.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [cell addSubview:view_topLine];
        
        //头像
        self.image_heads = [[UIImageView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(view_topLine.frame) + 15, 60, 60)];
        self.image_heads.userInteractionEnabled = YES;
        self.image_heads.layer.cornerRadius = 30;
        self.image_heads.layer.masksToBounds = YES;
        self.image_heads.image = [UIImage imageNamed:@"heads.jpg"];
        [cell addSubview:self.image_heads];
        //
        UIButton * btn_imageHeads = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_imageHeads.frame = CGRectMake(0, 0, 60, 60);
        [self.image_heads addSubview:btn_imageHeads];
        [btn_imageHeads addTarget:self action:@selector(btn_imageHeadsAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //姓名
        self.name = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.image_heads.frame) + 10, CGRectGetMaxY(view_topLine.frame) + 20, SCREEN_WIDTH - CGRectGetMaxX(self.image_heads.frame) - 10 - 70, 20)];
        self.name.text = @"员工-XXX";
        self.name.textColor = [UIColor blackColor];
        self.name.font = [UIFont systemFontOfSize:17];
        if(SCREEN_WIDTH == 320)
        {
            self.name.font = [UIFont systemFontOfSize:15];
        }
        [cell addSubview:self.name];
        
        //提前拿到宽度
        CGFloat length_W = [@"网建项目部" boundingRectWithSize:CGSizeMake(1000, 20)    options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15]} context:nil].size.width;
        if(SCREEN_WIDTH == 320)
        {
            length_W = [@"网建项目部" boundingRectWithSize:CGSizeMake(1000, 20)    options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:13]} context:nil].size.width;
        }
        //部门
        self.department = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.name.frame), CGRectGetMaxY(self.name.frame) + 10, length_W, 20)];
        self.department.text = @"网建项目部";
        self.department.font = [UIFont systemFontOfSize:15];
        self.department.textColor = [UIColor grayColor];
        [cell addSubview:self.department];
        
        //职位
        self.job_title = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.department.frame) + 10, CGRectGetMinY(self.department.frame), SCREEN_WIDTH - CGRectGetMaxX(self.image_heads.frame) - 90 - length_W, 20)];
        self.job_title.text = @"软件开发工程师";
        self.job_title.textColor = [UIColor grayColor];
        self.job_title.font = [UIFont systemFontOfSize:15];
        if(SCREEN_WIDTH == 320)
        {
            self.department.font = [UIFont systemFontOfSize:13];
            self.job_title.font = [UIFont systemFontOfSize:13];
        }
        [cell addSubview:self.job_title];
        
        //微名片
        UIView * view_cardBG = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 65, CGRectGetMidY(self.name.frame), 80, 30)];
        view_cardBG.layer.cornerRadius = 15;
        view_cardBG.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [cell addSubview:view_cardBG];
        
        UIImageView * image_card = [[UIImageView alloc] initWithFrame:CGRectMake(7.5, 9, 12, 12)];
        image_card.userInteractionEnabled = YES;
        image_card.image = [UIImage imageNamed:@"barcode.png"];
        [view_cardBG addSubview:image_card];
        
        UILabel * lbl_card = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_card.frame) + 3, 7.5, 40, 15)];
        lbl_card.text = @"微名片";
        lbl_card.font = [UIFont systemFontOfSize:13];
        lbl_card.textColor = [UIColor grayColor];
        [view_cardBG addSubview:lbl_card];
        
        UIButton * btn_card = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_card.frame = CGRectMake(0, 0, 65, 30);
        [view_cardBG addSubview:btn_card];
        [btn_card addTarget:self action:@selector(btn_cardAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //中间线
        UIView * view_midLine = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.image_heads.frame) + 15, SCREEN_WIDTH, 1)];
        view_midLine.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [cell addSubview:view_midLine];
        
        //间距
        CGFloat length_x = SCREEN_WIDTH / 4;
        //通讯录
        UIView * view_tel = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(view_midLine.frame), length_x, 80)];
        [cell addSubview:view_tel];

        UIImageView * image_tel = [[UIImageView alloc] initWithFrame:CGRectMake((length_x - 30) / 2, 15, 30, 30)];
        image_tel.userInteractionEnabled = YES;
        image_tel.image = [UIImage imageNamed:@"Tel.png"];
        [view_tel addSubview:image_tel];
        
        UILabel * lbl_tel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(image_tel.frame) + 7, length_x, 15)];
        lbl_tel.text = @"通讯录";
        lbl_tel.textColor = [UIColor grayColor];
        lbl_tel.font = [UIFont systemFontOfSize:13];
        lbl_tel.textAlignment = NSTextAlignmentCenter;
        [view_tel addSubview:lbl_tel];
        
        UIButton * btn_tel = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_tel.frame = CGRectMake(0, 0, length_x, 80);
        [view_tel addSubview:btn_tel];
        [btn_tel addTarget:self action:@selector(btn_telAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //日程
        UIView * view_date = [[UIView alloc] initWithFrame:CGRectMake(length_x, CGRectGetMaxY(view_midLine.frame), length_x, 80)];
        [cell addSubview:view_date];
        
        UIImageView * image_date = [[UIImageView alloc] initWithFrame:CGRectMake((length_x - 30) / 2, 15, 30, 30)];
        image_date.userInteractionEnabled = YES;
        image_date.image = [UIImage imageNamed:@"Date.png"];
        [view_date addSubview:image_date];
        
        UILabel * lbl_date = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(image_date.frame) + 7, length_x, 15)];
        lbl_date.text = @"日程";
        lbl_date.textColor = [UIColor grayColor];
        lbl_date.font = [UIFont systemFontOfSize:13];
        lbl_date.textAlignment = NSTextAlignmentCenter;
        [view_date addSubview:lbl_date];
        
        UIButton * btn_date = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_date.frame = CGRectMake(0, 0, length_x, 80);
        [view_date addSubview:btn_date];
        [btn_date addTarget:self action:@selector(btn_dateAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //网盘
        UIView * view_Clouds = [[UIView alloc] initWithFrame:CGRectMake(length_x * 2, CGRectGetMaxY(view_midLine.frame), length_x, 80)];
        [cell addSubview:view_Clouds];
        
        UIImageView * image_Clouds = [[UIImageView alloc] initWithFrame:CGRectMake((length_x - 30) / 2, 15, 30, 30)];
        image_Clouds.userInteractionEnabled = YES;
        image_Clouds.image = [UIImage imageNamed:@"Clouds.png"];
        [view_Clouds addSubview:image_Clouds];
        
        UILabel * lbl_Clouds = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(image_Clouds.frame) + 7, length_x, 15)];
        lbl_Clouds.text = @"网盘";
        lbl_Clouds.textColor = [UIColor grayColor];
        lbl_Clouds.font = [UIFont systemFontOfSize:13];
        lbl_Clouds.textAlignment = NSTextAlignmentCenter;
        [view_Clouds addSubview:lbl_Clouds];
        
        UIButton * btn_Clouds = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_Clouds.frame = CGRectMake(0, 0, length_x, 80);
        [view_Clouds addSubview:btn_Clouds];
        [btn_Clouds addTarget:self action:@selector(btn_CloudsAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //钱包
        UIView * view_Packbag = [[UIView alloc] initWithFrame:CGRectMake(length_x * 3, CGRectGetMaxY(view_midLine.frame), length_x, 80)];
        [cell addSubview:view_Packbag];
        
        UIImageView * image_Packbag = [[UIImageView alloc] initWithFrame:CGRectMake((length_x - 30) / 2, 15, 30, 30)];
        image_Packbag.userInteractionEnabled = YES;
        image_Packbag.image = [UIImage imageNamed:@"Packbag.png"];
        [view_Packbag addSubview:image_Packbag];
        
        UILabel * lbl_Packbag = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(image_Packbag.frame) + 7, length_x, 15)];
        lbl_Packbag.text = @"钱包";
        lbl_Packbag.textColor = [UIColor grayColor];
        lbl_Packbag.font = [UIFont systemFontOfSize:13];
        lbl_Packbag.textAlignment = NSTextAlignmentCenter;
        [view_Packbag addSubview:lbl_Packbag];
        
        UIButton * btn_Packbag = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_Packbag.frame = CGRectMake(0, 0, length_x, 80);
        [view_Packbag addSubview:btn_Packbag];
        [btn_Packbag addTarget:self action:@selector(btn_PackbagAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //底部线
        UIView * view_bottomLine = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(view_tel.frame), SCREEN_WIDTH, 10)];
        view_bottomLine.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [cell addSubview:view_bottomLine];
    }
    else if(indexPath.row == 1)
    {
        MineListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell_list" forIndexPath:indexPath];
        
        cell.image_list.image = [UIImage imageNamed:@"Working.png"];
        cell.name_list.text = @"我的工作";
        
        return cell;
    }
    else if(indexPath.row == 2)
    {
        MineListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell_list" forIndexPath:indexPath];
        
        cell.image_list.image = [UIImage imageNamed:@"Collection.png"];
        cell.name_list.text = @"我的收藏";
        
        return cell;
    }
    else if(indexPath.row == 3)
    {
        MineListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell_list" forIndexPath:indexPath];
        
        cell.list_line.hidden = YES;
        cell.image_list.image = [UIImage imageNamed:@"Topic.png"];
        cell.name_list.text = @"我的话题";
        
        return cell;
    }
    else if(indexPath.row == 4)
    {
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        cell.backgroundColor = [UIColor groupTableViewBackgroundColor];
    }
    else if(indexPath.row == 5)
    {
        MineListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell_list" forIndexPath:indexPath];
        
        cell.list_line.hidden = YES;
        cell.image_list.image = [UIImage imageNamed:@"Drafts.png"];
        cell.name_list.text = @"草稿箱";
        
        return cell;
    }
    else if(indexPath.row == 6)
    {
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        cell.backgroundColor = [UIColor groupTableViewBackgroundColor];
    }
    
    return cell;
}

- (void )tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    switch (indexPath.row)
    {
        case 1:
        {
//            NSLog(@"点击进入我的工作");
            
            Mine_WorkingViewController * mine_WorkingViewController = [[Mine_WorkingViewController alloc] init];
            [self showViewController:mine_WorkingViewController sender:nil];
        }
            break;
        case 2:
        {
//            NSLog(@"点击进入我的收藏");
            
            Mine_CollectViewController * mine_CollectViewController = [[Mine_CollectViewController alloc] init];
            [self showViewController:mine_CollectViewController sender:nil];
        }
            break;
        case 3:
        {
//            NSLog(@"点击进入我的话题");
            
            Mine_TopicViewController * mine_TopicViewController = [[Mine_TopicViewController alloc] init];
            [self showViewController:mine_TopicViewController sender:nil];
        }
            break;
        case 5:
        {
//            NSLog(@"点击进入草稿箱");
            
            Mine_DraftsViewController * mine_DraftsViewController = [[Mine_DraftsViewController alloc] init];
            [self showViewController:mine_DraftsViewController sender:nil];
        }
            break;
        default:
            break;
    }
}

#pragma mark - 点击头像,进入个人信息
- (void )btn_imageHeadsAction:(UIButton *)sender
{
    NSLog(@"点击头像后,进入个人信息");
}

#pragma mark - 点击生成二维码
- (void )btn_cardAction:(UIButton *)sender
{
//    NSLog(@"点击生成二维码");
    
    self.view_shadow.hidden = NO;
    self.view_middleWihte.hidden = NO;
}

#pragma mark - 点击进入通讯录
- (void )btn_telAction:(UIButton *)sender
{
//    NSLog(@"点击进入通讯录");
    
    Mine_AddressbookViewController * mine_AddressbookViewController = [[Mine_AddressbookViewController alloc] init];
    [self showViewController:mine_AddressbookViewController sender:nil];
}

#pragma mark - 点击进入日程
- (void )btn_dateAction:(UIButton *)sender
{
//    NSLog(@"点击进入日程");
    
    Mine_ProgrammeViewController * mine_ProgrammeViewController = [[Mine_ProgrammeViewController alloc] init];
    [self showViewController:mine_ProgrammeViewController sender:nil];
}

#pragma mark - 点击进入网盘
- (void )btn_CloudsAction:(UIButton *)sender
{
//    NSLog(@"点击进入网盘");
    
    Mine_KanboxViewController * mine_KanboxViewController = [[Mine_KanboxViewController alloc] init];
    [self showViewController:mine_KanboxViewController sender:nil];
}

#pragma mark - 点击进入钱包
- (void )btn_PackbagAction:(UIButton *)sender
{//NSLog(@"点击进入钱包");
    Mine_WalletViewController * mine_WalletViewController = [[Mine_WalletViewController alloc] init];
    [self showViewController:mine_WalletViewController sender:nil];
}








































#pragma mark - 弹出二维码页面
- (void )p_barcode
{    
    self.view_shadow = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    self.view_shadow.backgroundColor = [UIColor blackColor];
    self.view_shadow.alpha = 0.7f;
    [[[UIApplication sharedApplication] keyWindow] addSubview:self.view_shadow];
    self.view_shadow.hidden = YES;
    
    CGFloat length_x = (SCREEN_HEIGHT - 350) / 2;
    
    self.view_middleWihte = [[UIView alloc] initWithFrame:CGRectMake(30, length_x, SCREEN_WIDTH - 60, 350)];
    self.view_middleWihte.backgroundColor = [UIColor whiteColor];
    self.view_middleWihte.layer.cornerRadius = 5;
    [[[UIApplication sharedApplication] keyWindow] addSubview:self.view_middleWihte];
    self.view_middleWihte.hidden = YES;
    
    UIButton * btn_cancel = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn_cancel.frame = CGRectMake(SCREEN_WIDTH - 60 - 25, - 10, 35, 35);
    [btn_cancel setBackgroundImage:[UIImage imageNamed:@"Cancel_blue.png"] forState:(UIControlStateNormal)];
    btn_cancel.backgroundColor = [UIColor whiteColor];
    btn_cancel.layer.cornerRadius = 17.5;
    [self.view_middleWihte addSubview:btn_cancel];
    [btn_cancel addTarget:self action:@selector(btn_cancelAction:) forControlEvents:(UIControlEventTouchUpInside)];
    
    //
    CGFloat length_barcode = (SCREEN_WIDTH - 60 - 350 / 2) / 2;
    
    self.image_barcode = [[UIImageView alloc] initWithFrame:CGRectMake(length_barcode, 350 / 6, 350 / 2, 350 / 2)];
    self.image_barcode.image = [UIImage imageNamed:@"Timg_pic.jpg"];
    [self.view_middleWihte addSubview:self.image_barcode];
    
    
    UILabel * lbl_detail = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.image_barcode.frame) + (350 / 6 - 20) / 2, SCREEN_WIDTH - 80, 20)];
    lbl_detail.text = @"请在微信中扫描二维码";
    lbl_detail.textColor = [UIColor grayColor];
    lbl_detail.textAlignment = NSTextAlignmentCenter;
    lbl_detail.font = [UIFont systemFontOfSize:15.0f];
    [self.view_middleWihte addSubview:lbl_detail];
    
    UIView * view_line = [[UIView alloc] initWithFrame:CGRectMake(0, 350 / 6 * 5 - 0.5 , SCREEN_WIDTH - 60, 1)];
    view_line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.view_middleWihte addSubview:view_line];
    
    //
    CGFloat length_btnX = (SCREEN_WIDTH - 60 - 30) / 2;
    
    UIButton * btn_editMessage = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn_editMessage.frame = CGRectMake(10, CGRectGetMaxY(view_line.frame) + (350 / 6 - 35) / 2, length_btnX, 35);
    btn_editMessage.backgroundColor = [UIColor colorWithRed:90/255.0 green:167/255.0 blue:239/255.0 alpha:1.0];
    btn_editMessage.layer.cornerRadius = 17;
    [btn_editMessage setTitle:@"编辑微名片" forState:(UIControlStateNormal)];
    [btn_editMessage setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    [self.view_middleWihte addSubview:btn_editMessage];
    [btn_editMessage addTarget:self action:@selector(btn_editMessageAction:) forControlEvents:(UIControlEventTouchUpInside)];

    
    UIButton * btn_shareMessage = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn_shareMessage.frame = CGRectMake(CGRectGetMaxX(btn_editMessage.frame) + 10, CGRectGetMaxY(view_line.frame) + (350 / 6 - 35) / 2, length_btnX, 35);
    btn_shareMessage.backgroundColor = [UIColor colorWithRed:90/255.0 green:167/255.0 blue:239/255.0 alpha:1.0];
    btn_shareMessage.layer.cornerRadius = 17;
    [btn_shareMessage setTitle:@"转发到微信" forState:(UIControlStateNormal)];
    [btn_shareMessage setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    [self.view_middleWihte addSubview:btn_shareMessage];
    [btn_shareMessage addTarget:self action:@selector(btn_shareMessageAction:) forControlEvents:(UIControlEventTouchUpInside)];
}

#pragma mark - 点击二维码界面
- (void )btn_cancelAction:(UIButton *)sender
{//NSLog(@"隐藏二维码页面");
    self.view_shadow.hidden = YES;
    self.view_middleWihte.hidden = YES;
}

- (void )btn_shareMessageAction:(UIButton *)sender
{
    NSLog(@"点击后分享到微信好友(友盟)");
}

- (void )btn_editMessageAction:(UIButton *)sender
{//NSLog(@"跳转到编辑界面");
    self.view_shadow.hidden = YES;
    self.view_middleWihte.hidden = YES;
    
    Micro_BusinessCardViewController * micro_BusinessCardViewController = [[Micro_BusinessCardViewController alloc] init];
    [self showViewController:micro_BusinessCardViewController sender:nil];
}

@end
